import 'package:wanxiang_app/generated/json/base/json_field.dart';
import 'package:wanxiang_app/generated/json/query_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class QueryEntity {
	late int code;
	late String msg;
	 List<QueryData> data = [];

	QueryEntity();

	factory QueryEntity.fromJson(Map<String, dynamic> json) => $QueryEntityFromJson(json);

	Map<String, dynamic> toJson() => $QueryEntityToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}

@JsonSerializable()
class QueryData {
	@JSONField(name: "is_self")
	late int isSelf;
	@JSONField(name: "img_url")
	late String imgUrl;
	@JSONField(name: "add_time")
	late String addTime;
	late String title;
	@JSONField(name: "category_text")
	late String categoryText;
	@JSONField(name: "sell_price")
	late String sellPrice;

	QueryData();

	factory QueryData.fromJson(Map<String, dynamic> json) => $QueryDataFromJson(json);

	Map<String, dynamic> toJson() => $QueryDataToJson(this);

	@override
	String toString() {
		return jsonEncode(this);
	}
}